/*
 * Copyright (C) 2020 Agrui
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once



typedef enum {
    IPC_API_RESULT_OK           = 0,
    IPC_API_RESULT_ERROR        = 1,
    IPC_API_RESULT_NO_MEMEORY   = 2,
    IPC_API_RESULT_TIMEOUT      = 3,
} IPC_API_RESULT_T;

#define SIM_STATE_UNKNOW    0
#define SIM_STATE_READY     1
#define SIM_STATE_NONE      2
#define SIM_STATE_LOCKED    3


typedef void* IPC_HANDLER;

typedef void (*ipcServiceResultCallback)(IPC_API_RESULT_T result, void* data, int dataLen, void* userData);

typedef void(*ipcStateChangedCallback)(int channelId, int state);
typedef void(*ipcServiceStateChangedCallback)(int channelId, int serviceId, int state);


#define INVALID_IPC_HANDLE       ((IPC_HANDLER)0)



IPC_API_RESULT_T ipcInit();
IPC_HANDLER ipcServiceInit(int subId, int serviceId);
void ipcServiceDeinit(IPC_HANDLER handler);

IPC_API_RESULT_T ipcBindClient(IPC_HANDLER handler);
void ipcDeinit();

IPC_API_RESULT_T ipcGetSimState(IPC_HANDLER handler, void* userData, ipcServiceResultCallback callback);

